package com.liuzhilong.infrastructure.basic.state;

import java.util.Random;

public class RealState2 implements State {
    @Override
    public String action(Host host) {
        System.out.println("状态"+ RealState2.class.getSimpleName()+"");
        //一系列逻辑
        System.out.println(RealState2.class.getSimpleName()+" 简单的逻辑");
        //变更状态
        if(new Random().nextInt(10)>5){
            //
            System.out.println(RealState2.class.getSimpleName()+"状态变更");
            host.setState(new RealState1());
        }
        return RealState2.class.getSimpleName()+" 计算结果";
    }
}
